<%@page import="cn.easybuy.entity.User"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<div class="top">
	<div class="logo">
		<a href="Index.html"><img src="../statics/images/logo.png" /> </a>
	</div>
	<div class="search">
		<form action="SelProductServlet" method="post">
			<input type="text" value="" class="s_ipt" name="productName" /> <input
				type="submit" value="搜索" class="s_btn" />
		</form>
		<span class="fl"><a href="#">咖啡</a><a href="#">iphone 6S</a><a
			href="#">新鲜美食</a><a href="#">蛋糕</a><a href="#">日用品</a><a href="#">连衣裙</a>
		</span>
	</div>
	<div id="searchBar">
		<div class="i_car">
			<div class="car_t">
				购物车 [ <span> <c:if
						test="${sessionScope.cart!=null && sessionScope.cart.items.size()>0}">
                    ${sessionScope.cart.items.size()}
                </c:if> <c:if
						test="${sessionScope.cart==null || sessionScope.cart.items.size()<=0}">
                   	 空
                </c:if> </span> ]
			</div>
			<div class="car_bg">
				<!--Begin 购物车未登录 Begin-->
				<c:if test="${sessionScope.LoginUser==null}">
					<div class="un_login">
						还未登录！<a href="Login.jsp" style="color:#ff4e00;">马上登录</a> 查看购物车！
					</div>
				</c:if>
				<!--End 购物车未登录 End-->
				<!--Begin 购物车已登录 Begin-->
				<c:if test="${sessionScope.LoginUser!=null }">
					<ul class="cars">
						<c:forEach items="${sessionScope.cart.items}" var="item">
							<li>
								<div class="img">
									<a href="#"><img
										src="${ctx}/statics/productImg/${item.product.fileName}"
										width="58" height="58" /> </a>
								</div>
								<div class="name">
									<a href="#">${item.product.name }</a>
								</div>
								<div class="price">
									<font color="#ff4e00">￥${item.product.price }</font>
									X${item.quantity}
								</div></li>
						</c:forEach>
					</ul>
					<div class="price_sum">
						共计&nbsp; <font color="#ff4e00">￥</font><span>${sessionScope.cart.sum}</span>
					</div>
					<div class="price_a">
						<a href="BuyCar.jsp">去购物车结算</a>
					</div>
				</c:if>
				<!--End 购物车已登录 End-->
			</div>
		</div>
	</div>

</div>